from django.contrib.auth.models import AbstractUser
from django.db import models


# Create your models here.
from django.db.models import PROTECT


class User(AbstractUser):
    """用户模型类"""
    mobile = models.CharField(max_length=11, unique=True, blank=True, null=True, verbose_name='手机号')
    company = models.CharField(max_length=255, unique=True, verbose_name='公司名', blank=True, null=True)
    company_api = models.CharField(max_length=255, unique=True, verbose_name='公司截单接口', blank=True, null=True)

    class Meta:
        db_table = 'tb_users'
        verbose_name = '用户'
        verbose_name_plural = verbose_name


# 用户资金表，产品本金&引流佣金
# TODO 两张表还是一张表?
# class Fund(models.Model):
#     """用户资金表"""
#     user_id = models.ForeignKey(User, on_delete=PROTECT, verbose_name='用户ID')
#     rmb = models.DecimalField(decimal_places=2,  verbose_name='产品金（人民币）')
#     jzb = models.DecimalField(decimal_places=2,  verbose_name='服务佣金（人民币）')


# TODO 企业资金账号&隶属员工账户资金管理方案
